3.189 \(\int \frac{\sec (e+f x) (a+a \sec (e+f x))}{c+d \sec (e+f x)} \, dx\)

Optimal. Leaf size=69 \[ \frac{a \tanh ^{-1}(\sin (e+f x))}{d f}-\frac{2 a \sqrt{c-d} \tanh ^{-1}\left (\frac{\sqrt{c-d} \tan \left (\frac{1}{2} (e+f x)\right )}{\sqrt{c+d}}\right )}{d f \sqrt{c+d}} \]

[Out]

(a*ArcTanh[Sin[e + f*x]])/(d*f) - (2*a*Sqrt[c - d]*ArcTanh[(Sqrt[c - d]*Tan[(e + f*x)/2])/Sqrt[c + d]])/(d*Sqr
t[c + d]*f)

________________________________________________________________________________________

Rubi [A]  time = 0.144089, antiderivative size = 69, normalized size of antiderivative = 1., number of steps used = 5, number of rules used = 5, integrand size = 29, \(\frac{\text{number of rules}}{\text{integrand size}}\) = 0.172, Rules used = {3998, 3770, 3831, 2659, 208} \[ \frac{a \tanh ^{-1}(\sin (e+f x))}{d f}-\frac{2 a \sqrt{c-d} \tanh ^{-1}\left (\frac{\sqrt{c-d} \tan \left (\frac{1}{2} (e+f x)\right )}{\sqrt{c+d}}\right )}{d f \sqrt{c+d}} \]

Antiderivative was successfully verified.

[In]

Int[(Sec[e + f*x]*(a + a*Sec[e + f*x]))/(c + d*Sec[e + f*x]),x]

[Out]

(a*ArcTanh[Sin[e + f*x]])/(d*f) - (2*a*Sqrt[c - d]*ArcTanh[(Sqrt[c - d]*Tan[(e + f*x)/2])/Sqrt[c + d]])/(d*Sqr
t[c + d]*f)

Rule 3998

Int[(csc[(e_.) + (f_.)*(x_)]*(csc[(e_.) + (f_.)*(x_)]*(B_.) + (A_)))/(csc[(e_.) + (f_.)*(x_)]*(b_.) + (a_)), x
_Symbol] :> Dist[B/b, Int[Csc[e + f*x], x], x] + Dist[(A*b - a*B)/b, Int[Csc[e + f*x]/(a + b*Csc[e + f*x]), x]
, x] /; FreeQ[{a, b, e, f, A, B}, x] && NeQ[A*b - a*B, 0]

Rule 3770

Int[csc[(c_.) + (d_.)*(x_)], x_Symbol] :> -Simp[ArcTanh[Cos[c + d*x]]/d, x] /; FreeQ[{c, d}, x]

Rule 3831

Int[csc[(e_.) + (f_.)*(x_)]/(csc[(e_.) + (f_.)*(x_)]*(b_.) + (a_)), x_Symbol] :> Dist[1/b, Int[1/(1 + (a*Sin[e
 + f*x])/b), x], x] /; FreeQ[{a, b, e, f}, x] && NeQ[a^2 - b^2, 0]

Rule 2659

Int[((a_) + (b_.)*sin[Pi/2 + (c_.) + (d_.)*(x_)])^(-1), x_Symbol] :> With[{e = FreeFactors[Tan[(c + d*x)/2], x
]}, Dist[(2*e)/d, Subst[Int[1/(a + b + (a - b)*e^2*x^2), x], x, Tan[(c + d*x)/2]/e], x]] /; FreeQ[{a, b, c, d}
, x] && NeQ[a^2 - b^2, 0]

Rule 208

Int[((a_) + (b_.)*(x_)^2)^(-1), x_Symbol] :> Simp[(Rt[-(a/b), 2]*ArcTanh[x/Rt[-(a/b), 2]])/a, x] /; FreeQ[{a,
b}, x] && NegQ[a/b]

Rubi steps

\begin{align*} \int \frac{\sec (e+f x) (a+a \sec (e+f x))}{c+d \sec (e+f x)} \, dx &=\frac{a \int \sec (e+f x) \, dx}{d}+\frac{(-a c+a d) \int \frac{\sec (e+f x)}{c+d \sec (e+f x)} \, dx}{d}\\ &=\frac{a \tanh ^{-1}(\sin (e+f x))}{d f}-\frac{(a (c-d)) \int \frac{1}{1+\frac{c \cos (e+f x)}{d}} \, dx}{d^2}\\ &=\frac{a \tanh ^{-1}(\sin (e+f x))}{d f}-\frac{(2 a (c-d)) \operatorname{Subst}\left (\int \frac{1}{1+\frac{c}{d}+\left (1-\frac{c}{d}\right ) x^2} \, dx,x,\tan \left (\frac{1}{2} (e+f x)\right )\right )}{d^2 f}\\ &=\frac{a \tanh ^{-1}(\sin (e+f x))}{d f}-\frac{2 a \sqrt{c-d} \tanh ^{-1}\left (\frac{\sqrt{c-d} \tan \left (\frac{1}{2} (e+f x)\right )}{\sqrt{c+d}}\right )}{d \sqrt{c+d} f}\\ \end{align*}

Mathematica [A]  time = 0.184981, size = 107, normalized size = 1.55 \[ \frac{a \left (\frac{2 (c-d) \tanh ^{-1}\left (\frac{(d-c) \tan \left (\frac{1}{2} (e+f x)\right )}{\sqrt{c^2-d^2}}\right )}{\sqrt{c^2-d^2}}-\log \left (\cos \left (\frac{1}{2} (e+f x)\right )-\sin \left (\frac{1}{2} (e+f x)\right )\right )+\log \left (\sin \left (\frac{1}{2} (e+f x)\right )+\cos \left (\frac{1}{2} (e+f x)\right )\right )\right )}{d f} \]

Antiderivative was successfully verified.

[In]

Integrate[(Sec[e + f*x]*(a + a*Sec[e + f*x]))/(c + d*Sec[e + f*x]),x]

[Out]

(a*((2*(c - d)*ArcTanh[((-c + d)*Tan[(e + f*x)/2])/Sqrt[c^2 - d^2]])/Sqrt[c^2 - d^2] - Log[Cos[(e + f*x)/2] -
Sin[(e + f*x)/2]] + Log[Cos[(e + f*x)/2] + Sin[(e + f*x)/2]]))/(d*f)

________________________________________________________________________________________

Maple [B]  time = 0.078, size = 135, normalized size = 2. \begin{align*}{\frac{a}{fd}\ln \left ( \tan \left ({\frac{fx}{2}}+{\frac{e}{2}} \right ) +1 \right ) }-{\frac{a}{fd}\ln \left ( \tan \left ({\frac{fx}{2}}+{\frac{e}{2}} \right ) -1 \right ) }-2\,{\frac{ac}{fd\sqrt{ \left ( c+d \right ) \left ( c-d \right ) }}{\it Artanh} \left ({\frac{\tan \left ( 1/2\,fx+e/2 \right ) \left ( c-d \right ) }{\sqrt{ \left ( c+d \right ) \left ( c-d \right ) }}} \right ) }+2\,{\frac{a}{f\sqrt{ \left ( c+d \right ) \left ( c-d \right ) }}{\it Artanh} \left ({\frac{\tan \left ( 1/2\,fx+e/2 \right ) \left ( c-d \right ) }{\sqrt{ \left ( c+d \right ) \left ( c-d \right ) }}} \right ) } \end{align*}

Verification of antiderivative is not currently implemented for this CAS.

[In]

int(sec(f*x+e)*(a+a*sec(f*x+e))/(c+d*sec(f*x+e)),x)

[Out]

1/f*a/d*ln(tan(1/2*f*x+1/2*e)+1)-1/f*a/d*ln(tan(1/2*f*x+1/2*e)-1)-2/f*a/d/((c+d)*(c-d))^(1/2)*arctanh(tan(1/2*
f*x+1/2*e)*(c-d)/((c+d)*(c-d))^(1/2))*c+2/f*a/((c+d)*(c-d))^(1/2)*arctanh(tan(1/2*f*x+1/2*e)*(c-d)/((c+d)*(c-d
))^(1/2))

________________________________________________________________________________________

Maxima [F(-2)]  time = 0., size = 0, normalized size = 0. \begin{align*} \text{Exception raised: ValueError} \end{align*}

Verification of antiderivative is not currently implemented for this CAS.

[In]

integrate(sec(f*x+e)*(a+a*sec(f*x+e))/(c+d*sec(f*x+e)),x, algorithm="maxima")

[Out]

Exception raised: ValueError

________________________________________________________________________________________

Fricas [A]  time = 0.64202, size = 622, normalized size = 9.01 \begin{align*} \left [\frac{a \sqrt{\frac{c - d}{c + d}} \log \left (\frac{2 \, c d \cos \left (f x + e\right ) -{\left (c^{2} - 2 \, d^{2}\right )} \cos \left (f x + e\right )^{2} - 2 \,{\left (c^{2} + c d +{\left (c d + d^{2}\right )} \cos \left (f x + e\right )\right )} \sqrt{\frac{c - d}{c + d}} \sin \left (f x + e\right ) + 2 \, c^{2} - d^{2}}{c^{2} \cos \left (f x + e\right )^{2} + 2 \, c d \cos \left (f x + e\right ) + d^{2}}\right ) + a \log \left (\sin \left (f x + e\right ) + 1\right ) - a \log \left (-\sin \left (f x + e\right ) + 1\right )}{2 \, d f}, -\frac{2 \, a \sqrt{-\frac{c - d}{c + d}} \arctan \left (-\frac{{\left (d \cos \left (f x + e\right ) + c\right )} \sqrt{-\frac{c - d}{c + d}}}{{\left (c - d\right )} \sin \left (f x + e\right )}\right ) - a \log \left (\sin \left (f x + e\right ) + 1\right ) + a \log \left (-\sin \left (f x + e\right ) + 1\right )}{2 \, d f}\right ] \end{align*}

Verification of antiderivative is not currently implemented for this CAS.

[In]

integrate(sec(f*x+e)*(a+a*sec(f*x+e))/(c+d*sec(f*x+e)),x, algorithm="fricas")

[Out]

[1/2*(a*sqrt((c - d)/(c + d))*log((2*c*d*cos(f*x + e) - (c^2 - 2*d^2)*cos(f*x + e)^2 - 2*(c^2 + c*d + (c*d + d
^2)*cos(f*x + e))*sqrt((c - d)/(c + d))*sin(f*x + e) + 2*c^2 - d^2)/(c^2*cos(f*x + e)^2 + 2*c*d*cos(f*x + e) +
 d^2)) + a*log(sin(f*x + e) + 1) - a*log(-sin(f*x + e) + 1))/(d*f), -1/2*(2*a*sqrt(-(c - d)/(c + d))*arctan(-(
d*cos(f*x + e) + c)*sqrt(-(c - d)/(c + d))/((c - d)*sin(f*x + e))) - a*log(sin(f*x + e) + 1) + a*log(-sin(f*x
+ e) + 1))/(d*f)]

________________________________________________________________________________________

Sympy [F]  time = 0., size = 0, normalized size = 0. \begin{align*} a \left (\int \frac{\sec{\left (e + f x \right )}}{c + d \sec{\left (e + f x \right )}}\, dx + \int \frac{\sec ^{2}{\left (e + f x \right )}}{c + d \sec{\left (e + f x \right )}}\, dx\right ) \end{align*}

Verification of antiderivative is not currently implemented for this CAS.

[In]

integrate(sec(f*x+e)*(a+a*sec(f*x+e))/(c+d*sec(f*x+e)),x)

[Out]

a*(Integral(sec(e + f*x)/(c + d*sec(e + f*x)), x) + Integral(sec(e + f*x)**2/(c + d*sec(e + f*x)), x))

________________________________________________________________________________________

Giac [B]  time = 2.03586, size = 178, normalized size = 2.58 \begin{align*} \frac{\frac{a \log \left ({\left | \tan \left (\frac{1}{2} \, f x + \frac{1}{2} \, e\right ) + 1 \right |}\right )}{d} - \frac{a \log \left ({\left | \tan \left (\frac{1}{2} \, f x + \frac{1}{2} \, e\right ) - 1 \right |}\right )}{d} + \frac{2 \,{\left (\pi \left \lfloor \frac{f x + e}{2 \, \pi } + \frac{1}{2} \right \rfloor \mathrm{sgn}\left (2 \, c - 2 \, d\right ) + \arctan \left (\frac{c \tan \left (\frac{1}{2} \, f x + \frac{1}{2} \, e\right ) - d \tan \left (\frac{1}{2} \, f x + \frac{1}{2} \, e\right )}{\sqrt{-c^{2} + d^{2}}}\right )\right )}{\left (a c - a d\right )}}{\sqrt{-c^{2} + d^{2}} d}}{f} \end{align*}

Verification of antiderivative is not currently implemented for this CAS.

[In]

integrate(sec(f*x+e)*(a+a*sec(f*x+e))/(c+d*sec(f*x+e)),x, algorithm="giac")

[Out]

(a*log(abs(tan(1/2*f*x + 1/2*e) + 1))/d - a*log(abs(tan(1/2*f*x + 1/2*e) - 1))/d + 2*(pi*floor(1/2*(f*x + e)/p
i + 1/2)*sgn(2*c - 2*d) + arctan((c*tan(1/2*f*x + 1/2*e) - d*tan(1/2*f*x + 1/2*e))/sqrt(-c^2 + d^2)))*(a*c - a
*d)/(sqrt(-c^2 + d^2)*d))/f